sub command {
  my ($self, $user, $name, $email, $msg, %style) = @_;
  if ($msg =~ /^$config->{prefix}(.*)/) {
    $msg =~ s/$config->{prefix}//g;
    my $rank = &staff($user);
    &cmd_owner($self, $user, $name, $email, $msg, %style) if ($rank eq 'owner');
    &cmd_admin($self, $user, $name, $email, $msg, %style) if ($rank eq 'admin');
    &cmd_smod($self, $user, $name, $email, $msg, %style) if ($rank eq 'smod');
    &cmd_mod($self, $user, $name, $email, $msg, %style) if ($rank eq 'mod');
    &cmd_guest($self, $user, $name, $email, $msg, %style) if ($user eq 'guest');
    &cmd_user($self, $user, $name, $email, $msg, %style) if (!$rank and $user ne 'guest');
  }
  elsif (exists $self->{callback}) {
    my $rank = &staff($user);
    &cmd_owner($self, $user, $name, $email, $msg, %style) if ($rank eq 'owner');
    &cmd_admin($self, $user, $name, $email, $msg, %style) if ($rank eq 'admin');
    &cmd_smod($self, $user, $name, $email, $msg, %style) if ($rank eq 'smod');
    &cmd_mod($self, $user, $name, $email, $msg, %style) if ($rank eq 'mod');
    &cmd_guest($self, $user, $name, $email, $msg, %style) if ($user eq 'guest');
    &cmd_user($self, $user, $name, $email, $msg, %style) if (!$rank and $user ne 'guest');
  }
}

1;